﻿
<!DOCTYPE html>
<html class="login-alone">
    <head>
        <title>客户登录</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link href="res/ui/css/screen.css?v=3.9" media="screen, projection" rel="stylesheet" type="text/css" >
        <link rel="stylesheet" type="text/css" href="res/ui/css/base.css?v=3.9">
        <link rel="stylesheet" type="text/css" href="res/passport/css/login.css?v=3.9">
        <!--[if lt IE 9]>
        <script>
        window.location="homepage/support";
        </script>
        <![endif]-->
    </head>
    <body>
        <div class="logina-logo" style="height: 55px">
           
        </div>
        <div class="logina-main main clearfix">
            <div class="tab-con">
                <div id="form-login">
                    <div id='login-error' class="error-tip"></div>
                    <table border="0" cellspacing="0" cellpadding="0" style="margin:auto">
                        <tbody>
                            <tr>
                                <th>账户</th>
                                <td width="245">
                                    <input id="username" type="text" name="username" placeholder="请输入账号" autocomplete="off" value=""></td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <th>密码</th>
                                <td width="245">
                                    <input id="password" type="password" name="password" placeholder="请输入密码" autocomplete="off">
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr class="find">
                                <th></th>
                                <td>
                                    <div>
                                        <label class="checkbox" for="chk11"><input style="height: auto;" id="chk11" type="checkbox" name="remember_me" >记住我</label>
                    
                                    </div>
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <th></th>
                                <td width="245"><input class="confirm" id="login" value="登  录"></td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>
                    <input type="hidden" name="refer" value="site/">
                </div>
            </div>
    
        </div>
        <div id="footer">
            <div class="copyright">Copyright © 2014 51shunshi.com All Rights Reserved. 顺势 版权所有</div>
        </div>   
		<script type="text/javascript" src="http://www.sucaihuo.com/Public/js/other/jquery.js"></script>
		<script src="layer/layer.js"></script>
		<script type="text/javascript">
				    // 提交
    $("#login").on("click",function(){
        var username = $("#username").val();
        var password = $("#password").val();
       
        if (username=="") {
            layer.alert('账户不能为空');
            return false;
        }
		if (password=="") {
            layer.alert('密码不能为空');
            return false;
        }
        var URL="controller/login.php";
        $.ajax({
            type: "post",
            url: URL,
            dataType:'json',
            data: {
                'username':username,
                'password':password,
            },
            success: function(data){
                	if(data.code == 200){
				layer.alert(data.msg, {
                        skin: 'layui-layer-lan'
                        ,closeBtn: 0
                    },function () {
                        window.location.href = "data.php";
                    });
			}else{
				layer.alert(data.msg);
				return false;
			}
            }
        });
    });
        </script>
    </body>
</html>
